<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticleOperateLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_operate_logs', function (Blueprint $table) {
            $table->increments('id')->comment('文章操作记录表');
            $table->integer('article_id')->nullable()->comment('文章ID')->default(0);
            $table->tinyInteger('operate_type')->nullable()->comment('操作类型（1:阅读；2:点赞；3喜欢；4收藏；5分享；6关注作者）')->default(0);
            $table->integer('user_id')->nullable()->comment('操作人ID')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_operate_logs');
    }
}
